package lumis.portal.monitor;

import lumis.portal.stability.StableMinor;

/**
 * Defines an aggregation type, used to specify how collected
 * aggregations are aggregated.
 * <p>
 * An event may be associated with any number of aggregation types. When 
 * monitoring data is collected for an event, the data with the same values for 
 * all its the event's aggregation types are consolidated together, 
 * and only the statistics for those data are stored, instead of storing all 
 * data raw values. This way, by defining the aggregation types for an event,
 * you are also specifying how fine or coarse grained the monitored data 
 * statistics are generated and stored.
 * </p>
 * <p>
 * This interface contains the constants for standard aggregation type keys.
 * </p>
 * @see lumis.portal.monitor
 * 
 * @stereotype entity
 * 
 * @version $Revision: 13093 $ $Date: 2011-05-28 18:40:18 -0300 (Sat, 28 May 2011) $
 * @since 4.1.0
 */
@StableMinor(version = "6.0", sinceVersion = "4.1")
public interface IAggregationType
{
	/**
	 * The key for the aggregation type that stores the authenticated user's login.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_USER_LOGIN = "lumis.portal.monitor.at.user.login";
	
	/**
	 * The key for the aggregation type that stores the authenticated user's groups.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_USER_GROUPS = "lumis.portal.monitor.at.user.groups";
	
	/**
	 * The key for the aggregation type that stores the authenticated user's current locale.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_USER_LOCALE = "lumis.portal.monitor.at.user.locale";
	
	/**
	 * The key for the aggregation type that stores the request's client ip address.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_REQUEST_CLIENT_IP = "lumis.portal.monitor.at.request.client.ip";
	
	/**
	 * The key for the aggregation type that stores the website of the current request.
	 * @see lumis.util.PortalUtil#getWebsite(javax.servlet.http.HttpServletRequest)
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_WEBSITE = "lumis.portal.monitor.at.website";
	
	/**
	 * The key for the aggregation type that stores the id of this JVM's server.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_SERVER = "lumis.portal.monitor.at.server.id";
	
	/**
	 * The key for the aggregation type that stores the (real) path of the current channel.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_CHANNEL_PATH = "lumis.portal.monitor.at.channel.path";
	
	/**
	 * The key for the aggregation type that stores the friendly path of the current channel.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_CHANNEL_FRIENDLY_PATH = "lumis.portal.monitor.at.channel.friendlypath";
	
	/**
	 * The key for the aggregation type that stores current service identifier.
	 * @since 6.0.0
	 */
	public static final String AGGREGATION_TYPE_SERVICE_ID = "lumis.portal.monitor.at.service.id";

	/**
	 * The key for the aggregation type that stores the name of the current page.
	 * The page's channel's is specified by {@link #AGGREGATION_TYPE_CHANNEL_PATH}
	 * or {@link #AGGREGATION_TYPE_CHANNEL_FRIENDLY_PATH}.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_PAGE_NAME = "lumis.portal.monitor.at.page.name";

	/**
	 * The key for the aggregation type that stores the identifier of the current page.
	 * @since 6.0.0
	 */
	public static final String AGGREGATION_TYPE_PAGE_ID = "lumis.portal.monitor.at.page.id";
	
	/**
	 * The key for the aggregation type that stores the name of the current service instance.
	 * The service instance's channel's is specified by {@link #AGGREGATION_TYPE_CHANNEL_PATH}
	 * or {@link #AGGREGATION_TYPE_CHANNEL_FRIENDLY_PATH}.
	 * @since 4.1.0
	 */
	public static final String AGGREGATION_TYPE_SERVICE_INSTANCE_NAME = "lumis.portal.monitor.at.si.name";

	/**
	 * The key for the aggregation type that stores the identifier of service interface.
	 * @since 6.0.0
	 */
	public static final String AGGREGATION_TYPE_SERVICE_INTERFACE_ID = "lumis.portal.monitor.at.serviceinterface.id";

	/**
	 * The key for the aggregation type that stores the identifier of service interface instance.
	 * @since 6.0.0
	 */
	public static final String AGGREGATION_TYPE_SERVICE_INTERFACE_INSTANCE_ID = "lumis.portal.monitor.at.serviceinterfaceinstance.id";
	
	/**
	 * The key for the aggregation type that stores the path of XSL used in interface instance.
	 * @since 6.0.0
	 */
	public static final String AGGREGATION_TYPE_SERVICE_INTERFACE_INSTANCE_XSL_FILE = "lumis.portal.monitor.at.serviceinterfaceinstance.xslfile";
	
	/**
	 * Returns the identifier for this aggregation type.
	 * @return the identifier for this aggregation type.
	 * @since 4.1.0
	 */
	public String getId();

	/**
	 * Returns the description for this aggregation type. The description is localizable
	 * using {@link #getStringResourcePath()}.
	 * @return the description for this aggregation type.
	 * @since 4.1.0
	 */
	public String getDescription();

	/**
	 * Sets the description for this aggregation type.
	 * @param description the description to set.
	 * @see #getDescription()
	 * @since 4.1.0
	 */
	public void setDescription(String description);

	/**
	 * Returns the name for this aggregation type. The name is localizable
	 * using {@link #getStringResourcePath()}.
	 * @return the name for this aggregation type.
	 * @since 4.1.0
	 */
	public String getName();

	/**
	 * Sets the name for this aggregation type.
	 * @param name the name to set.
	 * @see #getName()
	 * @since 4.1.0
	 */
	public void setName(String name);

	/**
	 * The string resource path for localizing this aggregation type's strings.
	 * @return the string resource path. 
	 * @since 4.1.0
	 */
	public String getStringResourcePath();
	/**
	 * Sets the string resource path for this aggregation type.
	 * @param stringResourcePath the string resource path.
	 * @see #getStringResourcePath()
	 * @since 4.1.0
	 */
	public void setStringResourcePath(String stringResourcePath);
	
	/**
	 * Returns the key for this aggregation type. This key is a friendly unique 
	 * identifier for this aggregation type.
	 * @return this aggregation type's key.
	 * @since 4.1.0
	 */
	public String getAggregationTypeKey();

	/**
	 * Sets the key for this aggregation type.
	 * @param key the key.
	 * @see #getAggregationTypeKey()
	 * @since 4.1.0
	 */
	public void setAggregationTypeKey(String key);
}